Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

p-finally

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-finally

`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.4M
decreased by-55.66%
Maintainers
1
Weekly downloads
 
Created

What is p-finally?

The p-finally npm package is designed to allow you to attach a handler that will be called when a promise is settled (either fulfilled or rejected). This is useful for running cleanup code or finalizing operations, regardless of the promise's outcome.

What are p-finally's main functionalities?

Attaching a finally handler to a promise

This feature allows you to execute code after a promise has been settled, regardless of whether it was fulfilled or rejected. It's particularly useful for cleanup operations.

const pFinally = require('p-finally');

const promise = new Promise((resolve, reject) => {
  // Some asynchronous operation
});

pFinally(promise, () => {
  // Code to run on promise settlement
});

Other packages similar to p-finally

Keywords

FAQs

Package last updated on 21 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc